*****Preuhs and Hero "State Context and Partisan-Ideological Sorting****

***The code below replicates the Figures 2 and 5 in the main manuscript.

***The dataset was created from the margins, contrasts generated in the main body of replication code.
**Contrast were then entered to create a new dataset, "Context and Sorting Contrasts.dta"
**NOTE:  Contrasts and CIs for Figure 2 were reverse coded (value * -1) to ease interpretation.
**Figures were then created from this new dataset.

***Use "C: Context and Sorting Contrasts.dta"

**Both graphs were created with the code below and cleaned with Stata Graph Editor

****Figure 2


*Contrast Graph
twoway (rcap l_boundary u_boundary metric_race, lcolor(gs10) horizontal) (scatter metric_race contrast, mcolor(black) msize(vsmall)) if PID==1, ylabel(1(1)3, angle(horizontal) valuelabel) ymtick(none, valuelabel) xline(0, lcolor(gs5)) by(metric_context, cols(1) )
graph save Figure_2.gph


****Figure 5

*Contrast Graph
twoway (rcap l_boundary u_boundary metric_race, lcolor(gs10) horizontal) (scatter metric_race contrast, mcolor(black) msize(vsmall)) if PID==0, ylabel(4 5, angle(horizontal) valuelabel) ymtick(none, valuelabel) xline(0, lcolor(gs5)) by(metric_context, cols(1) )
graph save Figure_5.gph


********************************************
